package nowcoder;

import java.util.Scanner;

/**
 * @author： hmm
 * @date： 2020/7/16 15:52
 * @description： 字符串出现的次数
 * @modifiedBy：
 */
public class StrAppearCount {
    public static void main(String[] args) {
        Scanner f = new Scanner(System.in);
        Scanner t = new Scanner(System.in);
        String first = f.nextLine();
        String second = t.nextLine();

        char[] fChar = first.toCharArray();
        int i = 0;
        for (Character c : fChar) {
            String s = String.valueOf(c);
            if (s.equalsIgnoreCase(second)) {
                i ++;
            }
        }
        System.out.println(i);
    }
}
